<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:include href="core\form.xsl"/>
<xsl:include href="core\layout_empty.xsl"/>
<xsl:template name="page_content">
	<xsl:call-template name="title_page">
		<xsl:with-param name="titleText">Streaming Video</xsl:with-param>
	</xsl:call-template>

	<xsl:variable name ="vessels_id"><xsl:value-of select="vessels_id"/></xsl:variable>
	
	&#160;&#160;&#160;
	<xsl:if test="string-length(message)>0">
		<font color="Red" face="Arial" size="2"><b><xsl:value-of select="message"/></b></font>
	</xsl:if>
	&#160;&#160;&#160;
	<xsl:if test="string-length(status)>0">
		<font color="Red" face="Arial" size="2"><b><xsl:value-of select="status"/></b></font>
	</xsl:if>
			<script type="text/javascript" src="http://www.yachtcouncil.org/FlvPlayer/swfobject.js"></script>
		<script type="text/javascript">
			function loadVideo(id){
				var so = new SWFObject("http://www.yachtcouncil.org/FlvPlayer/flvplayer.swf","mp" + id,"320","260","7");
				so.addVariable("file",escape("&amp;id=" + id + "&amp;dbCode=Video"));
				so.addVariable("autostart","true");
				so.addVariable("width","320");
				so.addVariable("height","260");
				so.addVariable("type","flv");
				
				
				so.addVariable("streamscript","http://www.yachtcouncil.com/get-file.aspx");
				so.write("flv-player");
				return false;
			}
		</script>
		<table cellspacing="8" align="center" width="100%">
			<tr>
				<td width="140" valign="top">
					<table width="100%">
						<xsl:for-each select="videos/video">
							<tr>
								<td>
									<div style="width:200px; height:300px; overflow-y:auto">
										<table>
											<tr>
												<td valign="top" align="center"><a href="#" onclick="return loadVideo({id});"><img width="69" height="54" src="http://yachtcouncil.com/get-file.aspx?id={id}&amp;dbCode=VideoThumbnail" border="1"/></a></td>
												<td valign="top"><span id="videoSize" style="color:{$color_main_first1}">Size: <strong><xsl:value-of select="size"/> Mb</strong></span></td>
											</tr>
										</table>
									</div>
								</td>
							</tr>
						</xsl:for-each>
					</table>
				</td>
				<td align="center" valign="middle" width="350" style="border:1px solid #576D8F;">
					<table width="100%" cellpadding="0" cellspacing="0">
						<tr>
							<td id="playerContainer" align="center">
								<p id="flv-player" width="350">
									<span id="VideoHelp" style="color:{$color_main_first1}">Click on image to play video</span>
								</p>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		<script type="text/javascript">
			document.onload = loadVideo(<xsl:value-of select="/page/videos/video[1]/id"/>);
		</script>
	
	<hr width="80%" size="1" noshade="true" color="#CCCCCC"/>
		<table cellpadding="2" cellspacing="2" align="center">
			<tr>
				<td align="center"><a href="#" onClick="window.close();"><img src="{$img_path_templates}/{$header_bg_color}/buttons/btn_close.gif" border="0"/></a></td>
			</tr>
		</table>

</xsl:template>
</xsl:stylesheet>
